from flask import Flask, render_template

app = Flask(__name__)


@app.route('/')
def index():
    return render_template('index.html')


@app.route('/user/<username>')
def user(username):
    return render_template('user.html', name=username)


if __name__ == '__main__':
    app.run()

# @app.route('/user/<username>')
# def show_user_profile(username):
#     # 显示该用户的用户信息
#     return 'User %s' % username
#
#
# @app.route('/post/<int:post_id>')
# def show_post(post_id):
#     # 根据ID显示文章，ID是整形数级
#     return 'Post %d' % post_id
#
#
# if __name__ == '__main__':
#     app.run()
